from openai import OpenAI
 
def get_deepseek_response(content):
    client = OpenAI(api_key="sk-05ed98edde334bce8936f9bfa13fd739", base_url="https://api.deepseek.com")
    
    response = client.chat.completions.create(
        model="deepseek-chat",
        messages=[
            {"role": "system", "content": "You are a helpful assistant"},
            {"role": "user", "content": content},
        ],
        stream=False
    )    
    return response.choices[0].message.content

user_input ="我给你一段日志 格式如下  时间|序列号|IP|延时|状态  帮我看一下数据 如果状态是失败 返回JSON串内容为日志内容 数据如下 2025-08-31 14:30:39|16|47.100.42.127|28.2|失败" 
response = get_deepseek_response(user_input)
print(response)

